package com.asset.dispoal.business.bsAgreement.service.commom;

import com.asset.dispoal.business.bsAgreement.domain.db.mapper.AgreementMapper;
import com.asset.dispoal.business.bsAgreement.dto.AgreementDataResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tech.mhuang.pacebox.core.ddd.BaseCommand;

/**
 * @author qr
 * @date 2022/4/12$
 */
@Component
public class QueryAgreementDataCommand implements BaseCommand<String, AgreementDataResponse> {

    @Autowired
    AgreementMapper agreementMapper;

    @Override
    public AgreementDataResponse execute(String s) {
        AgreementDataResponse agreementDataResponse = agreementMapper.queryAgreementData(s);
        agreementDataResponse.setRecordResponseList(agreementMapper.queryStateRecordById(s));
        return agreementDataResponse;
    }
}